<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    const promise1 = new Promise((resolve, reject) => {
        console.log('promise1') 
        resolve('resolve') // 立刻 第一个宏任务 pending -> fulfilled
   })
   // promise1.then的返回值还是promise
   const promise2 = promise1.then(res =>{
       console.log(res)
       return new Promise((resolve,reject)=>{
           // console.log(promise2,'----------')
           resolve(1111)
           console.log(promise2,'----------')
       })
   })

   // promise2.then()
   console.log(promise2,'---------')
   console.log(1,promise1);// 1 Promise {fulfilled}
   console.log(2,promise2);// 2 Promise {}
    </script>
</body>
</html>